#include<iostream>
using namespace std;
typedef long long LL;
LL fun(int a, int b)
{
	LL sum = 0;
	for (int i = a; i <= b; i++) {
		int k = i;
		int ans = 0;
		while (k) {
			ans += k % 10;
			k /= 10;
		}
		if (ans % 5 == 0) {
			sum++;
		}
	}
	return sum;
}
int main()
{
	int a, b;
	cin >> a >> b;
	LL ans = fun(a, b);
	cout << ans << endl;
	return 0;
}